<template>
  <div>
    <a-modal
      v-model:open="modalOpen"
      title="申请详情"
      width="50%"
      :footer="null"
    >
      <a-space direction="vertical" style="width: 100%" :size="16">
        <a-descriptions title="" :column="{ xxl: 3 }">
          <a-descriptions-item label="申请编号">{{
            formData.code
          }}</a-descriptions-item>
          <a-descriptions-item label="商品类目">{{
            formData.category
          }}</a-descriptions-item>
          <a-descriptions-item label="子 类 目">{{
            formData.subCategory
          }}</a-descriptions-item>
          <a-descriptions-item label="品 牌">{{
            formData.brandName
          }}</a-descriptions-item>
          <a-descriptions-item label="商品名称">{{
            formData.name
          }}</a-descriptions-item>
          <a-descriptions-item label="发售价格"
            >{{ formData.price }}元</a-descriptions-item
          >
          <a-descriptions-item label="商品图片">
            <a-image
              :src="formData.img"
              :preview="{
                src: formData.img,
              }"
              :width="60"
            />
          </a-descriptions-item>
          <a-descriptions-item label="外网销售链接">{{
            formData.linkUrl
          }}</a-descriptions-item>
          <a-descriptions-item label="申请状态">
            <a-tag :bordered="false" v-if="formData.status == 0" color="warning"
              >审核中</a-tag
            >
            <a-tag :bordered="false" v-if="formData.status == 1" color="success"
              >成功</a-tag
            >
            <a-tag :bordered="false" v-if="formData.status == 2" color="error"
              >已拒绝</a-tag
            >
          </a-descriptions-item>
          <a-descriptions-item v-if="formData.status == 2" label="拒绝原因">{{
            formData.reason
          }}</a-descriptions-item>
        </a-descriptions>
      </a-space>
    </a-modal>
  </div>
</template>
<script setup>
import { ref } from "vue";
import { applyGoodsDetail } from "@/api/goods";
const modalOpen = ref(false);

const formData = ref({});

const open = async (formDatas) => {
  formData.value = formDatas;
  modalOpen.value = true;
};

defineExpose({ modalOpen, open });
</script>

<style lang="less"></style>
